package chapter67;

public class Penguin extends Pet {
	private int strain;
	private int sex;
	private String strain1;
	private String sex1="Q仔";
	
	public Penguin(){
		
	}
	
	public Penguin(String name, String sex1){
		super(name);
		this.sex1 = sex1;
	}

	public void setStrain(int strain) {
		strain1 = this.strain==1?"狗狗":"企鹅";
		this.strain = strain;
		
	}

	public void setSex(int sex) {
		sex1 = this.sex==1?"Q仔":"Q妹";
		this.sex = sex;
	}

	public int getStrain() {
		return this.strain;
	}

	public int getSex() {
		return this.sex;
	}

	//输出企鹅的信息
	public void showInfo() {
		super.showInfo();
		System.out.println("，我的性别是" +sex1);
	}
	
	public void toHospital(){
		System.out.println("吃药，疗养！");
		this.setHealth(70);
	}
	
	public void toEat(){
		System.out.println("吃水草");
		this.health += 5;
	}
	
	//企鹅特有的方法：在南极游泳
	public void swim(){
		System.out.println("企鹅在南极游泳");
	}

}
